        //用于检验当前状态是否是登陆
        function getUserInfo(pageName){
            $.ajax({
                type: 'get',
                url: "/user/loginin",
                success: function(body) {
                    if(body.userId && body.userId > 0) {
                        console.log("当前用户登录成功!用户名: "+body.username);
                        if(pageName == "blog_list.html") {
                            ChangeUserName(body.username);
                        }
                        let h3 = document.querySelector('.card>h3');
                        h3.innerHTML = body.username;

                    } else {
                        alert('当前你未登陆,请登录后再操作')
                        location.assign('blog_login.html');
                    }
                },
                error: function() {
                    alert('当前你未登陆,请登录后再操作')
                    location.assign('blog_login.html');
                }
            })
        }

        getUserInfo();
        

        function ChangeUserName(username) {
            let h3 = document.querySelector('.card>h3');
            h3.innerHTML = username;
        }